import { axios } from '@/utils/request'

const api = {
  getConfig: '/wechat-config/config',
  setConfig: '/wechat-config/save',
}

export default api

export function getWechatConfig(parameter) {
  return axios({
    url: api.getConfig,
    method: 'get',
    params: parameter,
  })
}

export function setWechatConfig(parameter) {
  return axios({
    url: api.setConfig,
    method: 'post',
    data: parameter,
  })
}

export function getStoreInfo(params) {
  return axios({
    url: '/store/get-store-info',
    method: 'get',
    params,
  })
}

export function getMenuList(params) {
  return axios({
    url: '/wechat-menu-config/get-menu-list',
    method: 'get',
    params,
  })
}

export function getMenuInfo(params) {
  return axios({
    url: '/wechat-menu-config/get-menu-info',
    method: 'get',
    params,
  })
}

export function setMenuList(data) {
  return axios({
    url: '/wechat-menu-config/set-menu-config',
    method: 'post',
    data,
  })
}

export function delMenu(params) {
  return axios({
    url: '/wechat-menu-config/del-menu',
    method: 'get',
    params,
  })
}

export function setAppParams(data) {
  return axios({
    url: '/store/set-app-params',
    method: 'post',
    data,
  })
}

export function getAppParams() {
  return axios({
    url: '/store/set-app-params',
    method: 'get',
  })
}
